import request from '@/utils/request'

// 获取公告列表
export function getList(params) {
  return request({
    url: '/api/announcement/list',
    method: 'get',
    params
  })
}

// 获取公告详情
export function getDetail(id) {
  return request({
    url: `/api/announcement/${id}`,
    method: 'get'
  })
}

// 添加公告
export function add(data) {
  return request({
    url: '/api/announcement',
    method: 'post',
    data
  })
}

// 更新公告
export function update(id, data) {
  return request({
    url: `/api/announcement/${id}`,
    method: 'put',
    data
  })
}

// 删除公告
export function remove(id) {
  return request({
    url: `/api/announcement/${id}`,
    method: 'delete'
  })
} 